﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        let age = 22;
        console.log(typeof age);

        //1.number转化为字符串
        age = age.toString();
        console.log(typeof age);

        //2.强制转化
        let score = String(100);
        console.log(typeof score);

        //3.prompt()接受的数据为字符串
        let year = prompt("请输入你的出生日日期")
        console.log(typeof year);

    </script>
</body>
</html>